﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FazaDemo.BL.InterfaceDomain;
using FazaDemo.BL.Services_;
using FazaDemo.BL.SubDomains;
using FazaDemo.BL.DataAccess;
using FazaDemo.Data;
using FazaDemo.BL.Factories;

namespace FazaDemo.BL.Services_
{
    public class NavCondConverter : INavCondConverter
    {

        private readonly NavTittleGenerator _tittleGener;

        private readonly NavCondParser _parser;

        public NavCondConverter()
        {
            _tittleGener = new NavTittleGenerator();
            _parser = new NavCondParser();
        }

        public NavigatorCondition GenerateCondition(string ecqText)
        {
            string tittle = _tittleGener.GetTittle(ecqText);
            IList<NavCondElement> navElements = _parser.GenerateNavCondElems(ecqText);
            return new NavigatorCondition {Tittle = tittle, CondElements = navElements};
        }

    }
}
